<template>
    <div>
        <div class="page-title">添加教师</div>
        <el-form ref="form" :model="form" label-width="100px">
            <el-form-item label="手机号.">
                <el-input  v-model="form.title" placeholder="请输入手机号"></el-input>
            </el-form-item>

            <el-form-item label="姓名">
                <el-input  v-model="form.name" placeholder="请输入姓名"></el-input>
            </el-form-item>

            <el-form-item label="密码">
                <el-input  v-model="form.password" placeholder="请输入密码"></el-input>
            </el-form-item>

            <el-form-item>
                <el-button type="success" icon="el-icon-check" @click="submit">添加</el-button>
                <el-button icon="el-icon-close" @click="cancel">取消</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import {
        post
    } from '@/network/request'

    export default {
        name: 'AddManager',
        data() {
            return {
                form: {
                }
            }
        },
        mounted() {
            this.form.status = true
        },
        methods: {
            // 提交
            submit() {
                post('/notice/add', this.form).then(res => {
                    const result = res.data
                    if (result.code == 200) {
                        this.$notify.success({
                            title: '系统提示',
                            message: '操作成功',
                            offset: 70
                        })
                        this.$router.go(-1)
                    }
                }).catch()
            },
            // 取消
            cancel() {
                this.$router.push('/manager')
            }
        }
    }
</script>

<style>
</style>